package net.shopxx.entity;

import java.math.BigDecimal;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;

/**
 * 实体类 - 购物车项
 */

@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.STRING)
public class CartItem extends BaseEntity {

	private static final long serialVersionUID = -4241469437632553865L;

	public static final String TYPE_PRODUCT = "p";// 产品类型
	public static final String TYPE_GROUPBUY = "g";// 团购
	public static final String TYPE_AIRTICKET = "a";// 机票
	public static final String TYPE_HOTEL = "h";// 产品类型

	protected Integer quantity;// 数量

	protected BigDecimal price;// 团购价格

	protected Member member;// 会员


	@Column(nullable = false)
	public Integer getQuantity() {
		return quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(nullable = false)
	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}
	

}